**********************************************
Window Focus Logger 1.0 Command-line version
Copyright(c) www.adminscope.com 2014
Free for personal and commercial use.
**********************************************

Get started:
- Verify if you have the Microsoft .NET Framework 4 installed.
- Place the Window Focus Logger executable on location where you have write-permissions.
- Write permissions are necessary because of the logfile that will be created on the same location.
- Just launch the executable with the available options specific for you situation.
 
Information about command-line arguments:
Time           //Time in seconds and is required.
-show          //Output to screen, by default it runs hidden.
-overwritelog  //Overwrites previous logfile, by default append.

Examples:
WindowFocusLogger.exe 300
300 results in 5 minutes of logging.
WindowFocusLogger.exe 3600 -show
3600 results in 1 hour of logging with output to screen.

Logfile example:
Below you see an example about what is logged, as you can see it will tell you which process takes the focus and when it occurs.

Focus changed;22/02/2014 23:15:56;Name:Lock the Taskbar;Processname:explorer;Offscreen:False;KeyboardFocus:True;UIenabled:True;FrameworkID:Win32;ChildID:10;ObjectID:-4
Focus changed;22/02/2014 23:15:56;Name:Task Manager;Processname:explorer;Offscreen:False;KeyboardFocus:True;UIenabled:True;FrameworkID:Win32;ChildID:8;ObjectID:-4
Focus changed;22/02/2014 23:15:57;Name:svchost.exe;Processname:taskmgr;Offscreen:False;KeyboardFocus:True;UIenabled:True;FrameworkID:Win32;ChildID:0;ObjectID:-4

The logfile can be read into excel because it is semicolon separated.

GUI version:
Check the executable WindowFocusLoggerGUI.exe, which is a graphical version of the Window Focus Logger.